package edu.vital.energy.longevity.ch08.controller;

import edu.vital.energy.longevity.ch08.domain.Article;
import edu.vital.energy.longevity.ch08.mapper.ArticleMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.*;

/**
 * @Classname LoginController
 * @Description TODO
 * @Date 2019-4-10 11:29
 * @Created by CrazyStone
 */
 public class LoginController {

    /**
     * 获取并封装当前年份跳转到登录页login.html
     * @param model
     * @return
     */

    public String toLoginPage(Model model){
        return "login";
    }

    /**
     * 处理登录请求
     * @param username
     * @param password
     * @param model
     * @return
     */
    public String login(@RequestParam String username, @RequestParam String password, Model model) {

        return "index";
    }
    @GetMapping("name")//页面的url地址
    public String getindex(Model model)//对应函数
    {
      return "1";
    }
}